package com.taotao.feign;

import com.taotao.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author wangjin
 * @title: LoginFeignService
 * @projectName wj-sc
 * @description:
 * @date 2021/10/27 9:30
 */
@FeignClient("app-oreder")
public interface LoginFeignService {
    @RequestMapping("/login")
    public String login();

    /**
     * feign 传递 string 类型的值
     *
     * @param name
     * @return
     * @RequestParam("name") String name  必须要有
     * 也可以 @RequestParam(value="name") String name  + value
     */
    @RequestMapping("/getName")
    public String getName(@RequestParam("name") String name);  //必须加上@RequestParam("name") 才能传值

    /**
     * feign 多个参数传值
     *
     * @param name
     * @param pass
     * @return
     */

    @RequestMapping("/getNameMore")
    public String getNameMore(@RequestParam("name") String name, @RequestParam(value = "pass") String pass);  //必须加上@RequestParam("name") 才能传值


    /**
     * feign 传递 model 类型的值
     *
     * @param user
     * @return
     * @RequestBody 必须要有
     */

    @RequestMapping("/getUser")
    public String getUser(@RequestBody User user);
}
